package com.isi.mtl.lf.ex3.managedbeans.holders;

import java.io.Serializable;
import java.util.ArrayList;
import javax.faces.model.SelectItem;

import com.isi.mtl.lf.ex3.entites.Marque;
import com.isi.mtl.lf.ex3.entites.Modele;
import com.isi.mtl.lf.ex3.managers.MarqueManager;
import com.isi.mtl.lf.ex3.managers.ModeleManager;

public class ListeMarqueHolder implements Serializable {
	
	/**
	 * 
	 */
	private static final long serialVersionUID = -3653667130167867202L;
	
	private ArrayList<SelectItem> alSelectItemMarques;
	

	public ArrayList<SelectItem> getAlSelectItemMarques() {
		
		if(alSelectItemMarques == null) {
			
			alSelectItemMarques = new ArrayList<SelectItem>();

			ArrayList<Marque> alMarques = MarqueManager.getAlMarques();

				for(Marque m : alMarques){
					alSelectItemMarques.add(new SelectItem(m.getIdMarque(), m.getDescMarque()));
				}
			
		}
		
		return alSelectItemMarques;
		
	}


	public void setAlSelectItemMarques(ArrayList<SelectItem> alSelectItemMarques) {
		this.alSelectItemMarques = alSelectItemMarques;
	}


}
